#!/usr/bin/env node

const http = require('http');

http.createServer((req,res)=>{
  if(req.url == '/'){
    let buf = Buffer.from('<html><body><h1>hello 张朦幻</h1></body></html>');
    res.setHeader('Content-Type','text/html;charset=utf-8');
    res.setHeader('Content-Length',`${buf.byteLength}`);
    res.end(buf.toString('utf8'));
  }else{
  res.statusCode = 404;
  res.end('ok');
  }
}).listen(8080)
